<include file="Base/header" /> 	
<div class="page-container">
	<include file="Base/menu" /> 
	<div class="page-content">
		<div class="container-fluid">
			<div class="row-fluid">
					<div class="span12"> 
						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<h3 class="page-title">
						</h3>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="/index.php/Admin/">首页</a> 
								<i class="icon-angle-right"></i>
							</li>
							<li><a href="#">其他管理</a></li>
							<i class="icon-angle-right"></i>
							<li><a href="#">新增</a></li>
						</ul>
						<!-- END PAGE TITLE & BREADCRUMB-->
					</div>
			</div>
			<div class="row-fluid">
				<div class="span12"> 
					<div class="portlet box blue tabbable">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-reorder"></i>
									<span class="hidden-480">新增</span>
							</div>
						</div>
					<div class="portlet-body form">
						<form  method="post" class="form-horizontal" id="formid">
							<div class="control-group"></div>
							<div class="control-group">
                        		<label class="control-label">抓捕分类：</label>
                                <div class="controls">
                                    <select placeholder="" class="m-wrap medium" name="cate_id" id="cate_id">
                                    <option>--请选择--</option>
                                        <foreach name="cate" item="v">
				                            <option value="{$v['id']}">{$v['cate_name']}</option>
				                        </foreach>
                                    </select>
                                    <span class="help-inline">请选择类型</span>
                                </div>
                            </div>
                            <div class="control-group">
                        		<label class="control-label">设备情况：</label>
                                <div class="controls">
                                    <select placeholder="" class="m-wrap medium" name="status_id" id="statusst">
                                        <option>--请选择--</option>
                                    </select>
                                    <span class="help-inline">请选择你要添加的商户</span>
                                </div>
                            </div>
                            <div class="control-group">
                        		<label class="control-label">设备情况二级：</label>
                                <div class="controls">
                                    <select placeholder="" class="m-wrap medium" name="status_ids" id="statussts">
                                        <option>--请选择--</option>
                                    </select>
                                    <span class="help-inline">请选择你要添加的商户</span>
                                </div>
                            </div>
							<div class="control-group">
								<label class="control-label">设备情况三级：</label>
								<div class="controls">
									<input name="status_name" type="text" class="m-wrap medium" value="">
								</div>
							</div>
							<div class="form-actions">
								<div type="submit" id="submit" class="btn blue"><i class="icon-ok"></i>添加</div>
								<!-- <button type="button" class="btn">删除</button> -->
							</div>
						</form>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<include file="Base/footer" />
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">

$("#submit").click(function(){
	var data=$('#formid').serialize();
   	$.ajax({
   		type:'POST',
   		dataType: "json",
        url: "{:U('Admin/Status/statusSt')}",
        data: data,
        success:  function(result){
        	if(result.status==1){
                layer.alert(result.info,function(){self.location="__MODULE__/Status/statusSt";});
            }else if(result.status==0){
                //失败
                layer.alert(result.info);
            }
        }
    });
});
$("#cate_id").change(function(){
	var data = $('#cate_id').val()
	$.ajax({
   		type:'POST',
   		dataType: "json",
        url: "{:U('Admin/Status/statusInfo')}",
        data: 'id='+data,
        success:  function(result){
        	$('#statusst').html(result);
        }
    });
});
$("#statusst").change(function(){
	var data = $('#statusst').val()
	// alert(data)
	$.ajax({
   		type:'POST',
   		dataType: "json",
        url: "{:U('Admin/Status/statusNext')}",
        data: 'id='+data,
        success:  function(result){
        	$('#statussts').html(result);
        }
    });
});

// $("#statussts").change(function(){
// 	var data = $('#statussts').val()
// 	// alert(data)
// 	$.ajax({
//    		type:'POST',
//    		dataType: "json",
//         url: "{:U('Admin/Status/statusNexts')}",
//         data: 'id='+data,
//         success:  function(result){ alert(result)
//         	$('#statussts').html(result);
//         }
//     });
// });
</script>
